home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-M68K / KGDB.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  84 lines

  1. /*
  2.  *  include/asm-m68k/kgdb.h
  3.  *
  4.  *  Copyright (C) 1996 Roman Hodek
  5.  */
  6.  
  7. #ifndef __ASM_M68k_KGDB_H
  8. #define __ASM_M68k_KGDB_H
  9.  
  10. /*
  11.  * Structure to save all register values in, already in the order gdb wants
  12.  * it. Note that the upper half of the SR field is recycled for the FORMAT and
  13.  * VECTOR fields. Hope that doesn't confuse gdb... That upper half is ignored
  14.  * on exiting the stub, so gdb can modify it as it likes.
  15.  */
  16.  
  17. #define GDBREG_A6    14
  18. #define GDBREG_A7    15
  19. #define GDBREG_SP    15
  20. #define GDBREG_SR    16
  21. #define GDBREG_PC    17
  22. #define GDBREG_FP0    18
  23. #define GDBREG_FP7    25
  24. #define GDBREG_FPCR    26
  25. #define GDBREG_FPIAR 28
  26.  
  27. #define GDBOFFA_D6    (6*4)
  28. #define GDBOFFA_A3    (11*4)
  29.  
  30. #define NUMREGSBYTES    180
  31.  
  32. #ifndef __ASSEMBLY__
  33.  
  34. struct gdb_regs {
  35.     long           regs[16];        /* d0-a7 */
  36.     unsigned       format :  4;     /* frame format specifier */
  37.     unsigned       vector : 12;     /* vector offset */
  38.     unsigned short sr;                /* status register */
  39.     unsigned long  pc;                /* program counter */
  40.     unsigned long  fpregs[8*3];        /* fp0-fp7 */
  41.     unsigned long  fpcntl[3];        /* fpcr, fpsr, fpiar */
  42. };
  43.  
  44. extern struct gdb_regs kgdb_registers;
  45. extern void kgdb_init( void );
  46. struct frame;
  47. extern asmlinkage void enter_kgdb( struct pt_regs *fp );
  48.  
  49. extern int kgdb_initialized;
  50.  
  51. /*
  52.  * This function will generate a breakpoint exception.  It is used at the
  53.  * beginning of a program to sync up with a debugger and can be used
  54.  * otherwise as a quick means to stop program execution and "break" into
  55.  * the debugger.
  56.  */
  57. extern inline void breakpoint( void )
  58. {
  59.     if (!kgdb_initialized)
  60.         /* if kgdb not inited, do nothing */
  61.         return;
  62.     
  63.     /* breakpoint instruction is TRAP #15 */
  64.     __asm__ __volatile__ ( "trap #15" );
  65. }
  66.  
  67. /*
  68.  * This function will report a SIGABORT to gdb.
  69.  */
  70. extern inline void kgdb_abort( void )
  71. {
  72.     if (!kgdb_initialized)
  73.         /* if kgdb not inited, do nothing */
  74.         return;
  75.     
  76.     /* TRAP #14 is reported as SIGABORT */
  77.     __asm__ __volatile__ ( "trap #14" );
  78. }
  79.  
  80. #endif /* __ASSEMBLY__ */
  81.  
  82. #endif /* __ASM_M68k_KGDB_H */
  83.  
  84.